package xyz.syyrjx.blog.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import xyz.syyrjx.blog.interceptor.LoginInterceptor;

@Configuration
public class LoginInterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        String pathNeed = "/admin/**";
        registry.addInterceptor(new LoginInterceptor()).addPathPatterns(pathNeed);
    }
}
